﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Microsoft.Win32;

namespace ChatBox.Utilities
{
  /// <summary>
  /// Interface used by view models to show dialogs.
  /// </summary>
  public interface IDialogService
  {
    /// <summary>
    /// Opens a window with the given view model and returns only when the newly
    /// opened window is closed.
    /// </summary>
    /// <typeparam name="T">Type of the window to show.</typeparam>
    /// <param name="_viewModel">View model to give to the dialog to show.</param>
    /// <returns>A <see cref="System.Nullable`1"/> value of type <see cref="T:System.Boolean"/> that signifies how the window was closed by the user.</returns>
    Boolean? ShowDialog<T>( Object viewModel ) where T : Window, new();

    /// <summary>
    /// Opens a window with the given view model and returns only when the newly
    /// opened window is closed.
    /// </summary>
    /// <typeparam name="T">Type of the window to show.</typeparam>
    /// <param name="_viewModel">View model to give to the dialog to show. It
    /// will have its DialogService property set.</param>
    /// <returns>A <see cref="System.Nullable`1"/> value of type <see cref="T:System.Boolean"/> that signifies how the window was closed by the user.</returns>
    Boolean? ShowDialog<T>( IDialogServiceClient viewModel ) where T : Window, new();

    /// <summary>
    /// Displays the given common dialog.
    /// </summary>
    /// <param name="_dialog">Dialog to display.</param>
    /// <returns>If the user clicks the OK button of the dialog that is displayed (e.g. <see cref="T:Microsoft.Win32.OpenFileDialog" />, <see cref="T:Microsoft.Win32.SaveFileDialog" />), true is returned; otherwise, false.</returns>
    Boolean? ShowDialog( CommonDialog dialog );
  }
}
